<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html><html lang="en">
	<head>
		<!--加载header文件-->
		<?php
		include_once 'public/views/header.php';
		?>
		<?php
		include_once 'public/home/html/treeView.php';
		?>
		<link rel="stylesheet" href="public/css/edit.css" />
		<script src="cust/js/chooseTeacher.js"></script>
		<script src="public/js/cus_modal.js"></script>
		<style>
			.tree{
				width:100%;
				padding:10px 20px 10px 20px;
				margin:20px 0 20px 0;
				/*border:1px solid #bbb;*/
				border-radius: 5px;
				background-color:#fff;
				/*border:none!important;*/
			}
			.checkbox{
				height:30px;
				/*line-height: 30px;*/
				/*border:1px solid #aaa;*/
				margin:0px!important;
				padding-left: 0px!important;
				min-height: 0px!important;
			}
			label{
				font-size: 14px;
			}
			.yn-tree-li{
				min-height:20px!important;
				padding-top: 0px!important;
			}
			.yn-tree-input {
				width:15px;
				height:15px;
				border:1px solid #438EB9!important;
			}
			.shrink{
				min-height:20px!important;
				padding-top: 0px!important;
			}
		</style>
	</head>
	<body>
		<div class="container" style="background-color:#fff;">
			<div class="row RadioStyle">
				<input type="hidden" id="modal_title" value="<?=$title ?>" />
				<input type="hidden" id="modal_height" value="450" />
				<input type="hidden" id="dataS" value="" />
			
				<form id="editForm">
				  <div style="margin-left:10%;margin-top:3%;">赛选条件 <input style="width:200px;" type="text" id="param" placeholder="工号/姓名/部门"/>
				   <button class="searchButton" style="width: 20%;"><i class="icon-search searchForm-title-icon"></i>搜索</button></div>
					<div id="treeview-checkable" class="tree">
					</div>
	
				</form>
				<div class="viewContent">
					<!--这是显示具体车辆信息情况的。-->
				</div>
			</div>
		</div>
	</body>
	
	<script>

		$(function(){
			// getDatas();
			searchButton();
			$(".searchButton").click(function(){
				$("#treeview-checkable").html('');
				searchButton();
			})
		})

		//获取树形数据
		function getDatas(){
			var new_Arr = [];
			$.ajax({
				url: "Admin/QualityReport/getchooseTeacher",
				type: "post",
				async : false,
				data: {value:$("#param").val()},
				success: function(dataS) {
						new_Arr = $.parseJSON(dataS);
				}
			});	
			return new_Arr;
			// console.log(new_Arr);
		}

		function searchButton(){
			var shijian={
				onchange:function (input, yntree){
					// console.log(this);
				}
			}
			var checkStrictly={
				checkStrictly:true
			}
			
			// var dataS = $("#dataS").val();
			
			// console.log(1111);
			// console.log(dataS);

			var dataValue={
					data:getDatas()
				}
			
			var defaultData=$.extend(shijian,checkStrictly,dataValue);
			// 是否严格的遵循父子互相关联的做法
			var yntree = new YnTree(document.getElementById("treeview-checkable"), defaultData);
		}
		
	

	</script>
</html>
